Skip to content

#7396 changing columns does not log status changes#183

Open
farukvukovic wants to merge 2 commits into
developfrom
feature/#7396-Changing-columns-does-not-log-status-changes
Open

#7396 changing columns does not log status changes#183
farukvukovic wants to merge 2 commits into
developfrom
feature/#7396-Changing-columns-does-not-log-status-changes

Conversation

@farukvukovic

@farukvukovic farukvukovic commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Description

  • On the Kanban board (/tickets/showKanban), when a user drags a ticket card to a different column, the ticket’s status is updated correctly, but the change is not recorded in the ticket’s activity/audit history, as a result, users could not see Kanban-driven status changes in the activity history UI.

Resolves: http://pearlog.pearshadow.com/tickets/showKanban?tab=ticketdetails#/tickets/showTicket/7396

farukvukovic and others added 2 commits July 10, 2026 15:57
Introduce logStatusChangeActivity() to write human-readable status
changes to zp_ticket_status_changes using TicketHistoryModel.

Co-authored-by: Cursor <cursoragent@cursor.com>
Detect status changes on the dragged ticket during kanban sort updates
and write them to zp_ticket_status_changes via logStatusChangeActivity().

Co-authored-by: Cursor <cursoragent@cursor.com>
@farukvukovic
farukvukovic requested a review from harismacic1 July 10, 2026 14:01
@farukvukovic farukvukovic self-assigned this Jul 10, 2026
@farukvukovic farukvukovic added the bug Something isn't working label Jul 10, 2026
@farukvukovic farukvukovic changed the title Feature/#7396 changing columns does not log status changes #7396 changing columns does not log status changes Jul 10, 2026
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Kanban ticket updates now capture the moved ticket’s previous state, compare it after bulk updates, and log changed statuses in ticket history using resolved status labels.

Changes

Ticket status history

Layer / File(s) Summary
Status history recording
app/Domain/Tickets/Services/Tickets.php
Adds TicketHistoryModel integration and a helper that resolves status labels and records status-select history entries with error logging.
Update flow integration
app/Domain/Tickets/Services/Tickets.php
Captures the handler ticket’s prior status, reloads it after updates, and logs the transition when the status changes.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Kanban as Kanban update flow
  participant Tickets as Ticket model
  participant Logger as logStatusChangeActivity
  participant History as TicketHistoryModel
  Kanban->>Tickets: Load handler ticket and capture prior status
  Kanban->>Tickets: Apply bulk status updates
  Kanban->>Tickets: Reload updated ticket
  Kanban->>Logger: Log changed status
  Logger->>History: Persist status-select activity
Loading

Poem

A bunny nudged a ticket along,
From one green lane to another with song.
The old and new names now leave a trail,
In history’s neat little detail.
Hop, hop—status changes prevail!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the change: Kanban column moves now log status changes.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/#7396-Changing-columns-does-not-log-status-changes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
app/Domain/Tickets/Services/Tickets.php (1)

2048-2050: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Complete the phpDoc for the new helper.

The doc block omits @param/@return. Add them to satisfy the project's phpDoc standard.

📝 Proposed phpDoc
     /**
      * Log a kanban status change to the ticket activity history.
+     *
+     * `@param`  int  $ticketId   The ticket whose status changed.
+     * `@param`  int  $oldStatus  The previous status id.
+     * `@param`  int  $newStatus  The new status id.
+     * `@param`  int  $projectId  The project id used to resolve status labels.
      */
     private function logStatusChangeActivity(

As per coding guidelines: "Add valid phpDoc comments to all methods and classes".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/Domain/Tickets/Services/Tickets.php` around lines 2048 - 2050, Complete
the phpDoc for the new kanban status-change helper by adding valid `@param` tags
for every method argument and an `@return` tag matching the method’s return type,
following the project’s existing documentation conventions.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@app/Domain/Tickets/Services/Tickets.php`:
- Around line 2048-2050: Complete the phpDoc for the new kanban status-change
helper by adding valid `@param` tags for every method argument and an `@return` tag
matching the method’s return type, following the project’s existing
documentation conventions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 65a94133-509f-43a6-8fdc-f13896608fa6

📥 Commits

Reviewing files that changed from the base of the PR and between 5540bda and cf40c32.

📒 Files selected for processing (1)
  • app/Domain/Tickets/Services/Tickets.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant